package com.iotechn.unimall.data.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.iotechn.unimall.data.domain.PurchaseWarehouseOrderGoodsDO;
import com.iotechn.unimall.data.domain.WarehouseOperLogDO;
import com.iotechn.unimall.data.dto.excel.SkuTotalPriceDTO;
import com.iotechn.unimall.data.dto.statistics.StatisticCurrencyDTO;
import com.iotechn.unimall.data.dto.statistics.TimeDataDTO;
import com.iotechn.unimall.data.dto.warehouse.PurchaseWarehouseOrderGoodsDTO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;


/**
 * @author wxw
 * @email
 * @date 2020-03-24 17:22:46
 */
public interface PurchaseWarehouseOrderGoodsMapper extends BaseMapper<PurchaseWarehouseOrderGoodsDO> {

    //查询待入库商品（包含当前库的商品数量）
    List<PurchaseWarehouseOrderGoodsDTO> querySkusByWarehouseId(@Param("warehouseId") Long warehouseId, @Param("skuIds") List<Long> skuIds, @Param("offset") Integer offset, @Param("size") Integer size, @Param("search") String search);

    //统计
    Integer countSkusByWarehouseId(@Param("warehouseId") Long warehouseId, @Param("skuIds") List<Long> skuIds, @Param("search") String search);

    //统计入库商品
    List<PurchaseWarehouseOrderGoodsDTO> querySkusByPara(@Param("warehouseId") Long warehouseId, @Param("pOrderId") Long pOrderId, @Param("offset") Integer offset, @Param("size") Integer size, @Param("search") String search);

    //统计入库商品
    Integer countByPara(@Param("warehouseId") Long warehouseId, @Param("pOrderId") Long pOrderId, Integer size, @Param("search") String search);


    //查询所有的入库的商品 按照审核时间排序
    //统计入库商品
    List<PurchaseWarehouseOrderGoodsDTO> querySkusByPaixu(@Param("warehouseId") Long warehouseId,@Param("skuId") Long skuId);

    List<Long> warehouseLogIdsByTime(@Param("selectTime") Date selectTime);

    List<WarehouseOperLogDO> warehouseLogIdsByList(@Param("ids")List<Long> ids);

/*
    StatisticCurrencyDTO purchaseWarehouseStatistic(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
    //按时间统计入库
    List<TimeDataDTO> summaryPurchaseOrderGoodsByTime(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("search") String search);

    List<SkuTotalPriceDTO> summaryGoods(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("skuIds") List<Long> skuIds, @Param("barCodes") List<String> barCodes);
    List<SkuTotalPriceDTO> summaryGoods_v2(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("skuIds") List<Long> skuIds, @Param("barCodes") List<String> barCodes);
    */
/** 补充无平均价的商品 *//*

    List<SkuTotalPriceDTO>  beginDataCompletion(@Param("lastEndDate") Date lastEndDate, @Param("skuIds") List<Long> skuIds);

    //计算平均价格
    List<SkuTotalPriceDTO> summaryGoodsWithPara(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("skuIds") List<Long> skuIds, @Param("barCodes") List<String> barCodes, @Param("warehouseId") Long warehouseId);
*/

}
